package com.lc.interceptor;

import javax.interceptor.AroundInvoke;
import javax.interceptor.InvocationContext;

/**
 * 自定义拦截器
 * 
 */
public class MyInterceptor {

	@AroundInvoke
	public Object doIt(InvocationContext context) {
		Object obj = null;
		System.out.println("当前执行的方法名称：" + context.getMethod());
		try {
			obj = context.proceed();// 让方法继续执行
		} catch (Exception e) {
			e.printStackTrace();
		}
		return obj;
	}

}
